<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\service\DesEncrypt;
use app\service\FXApiService;
use app\service\IyunBinkService;
use think\facade\Queue;
/**
 * 首页接口.
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页.
     */
    public function index()
    {
        $obClassName = 'app\job\test';
        // 2.当任务归属的队列名称，如果为新队列，会自动创建
        $FxLoginQueueName = "";
        $FxLoginQueueName2 = "";
        // 3.当前任务所需业务数据，不能为resource类型，其他类型最终将转化为json形式的字符串
        $jobData = ['ts' => time(),'name'=>1111];
        $jobData2= ['ts' => time(),'name'=>2222];
        // 4.将该任务推送到消息列表，等待对应的消费者去执行
        // 入队列，later延迟执行，单位秒，push立即执行
        Queue::later(10, $obClassName, $jobData, $FxLoginQueueName);
        Queue::later(10, $obClassName, $jobData2, $FxLoginQueueName2);
        $this->success('请求成功');
    }
    public function text(){
        // var_dump(111);
        $data=IyunBinkService::querySpreadRate('C4IpdxcTbdEpNR6zBBlXr1');
        return json_encode($data) ;
    }
    public function yxtext(){
        // var_dump(111);
        $data=IyunBinkService::querySpreadRate('C4IpdxcTbdEpNR6zBBlXr1',23521);
        return json_encode($data) ;
    }
    public function list(){
        $dec=new DesEncrypt('21,76,33,17,84,34,56,34');
        // $data=$dec->decrypt('Gd7Yf/P8YImiqs9Fl2aokTLN35+VBQZHPHxd+YqpuEJJ7RWpv+wOECTeUY572AqhF5nDhv3BjhmF
        // cJvkXrNrBULgQsXPCYMHaaxCS1fh0Js=');
        $data = IyunBinkService::RSA_openssl('UM8C84+tN9apQxRa2b9DDkbO2Ej8t3mBZD9X0\/2gsW5vSreTCYZaNXkf9kqC4IdBN9gp+0jyQRTCgef\/+hCiAdnvOTjcO2MtnwSTYjyCRprIKBsBNGI00lYFQIqrM9xNxNA+Zke5h\/aAFr2Y0Q9URKIygkT3iZrwKbEl3mIk7JUPV4O26H\/dQHbTUsAAO9edMQ6xuONemp1zxxDLSzEdluPWwy1KznHJGy7Wh1Da7By1TNklbwNPZdrZb1SY0xLOFW\/vdbsH+ycqTalGLNAkJ0q0UErPnjYkoYKQdRcwELlKfXutY6pKJC2iYMRiELNaBTPULG9X8M6H\/Pn3Z4ctkrBdrQ\/D5Ai0h8OqdAG2rXsh0SyW6\/cUI3zC3p\/NVfcLJMwDjY+nKF3CDGZbdN6DftrGyX15tpHYNTwCZ\/AURauCdcLQqGhrf4crac3F66OV9vzULZl0oUirXXnlPCHfJRhpDRhOlK00VCnYQK9Su214f+bHi6WWi6xomPh3rxK\/nBERpfzQXdLoByqt7SEW1kCM9mxODlYFO0v1YcaUVgYAJwnis4zfDq8HLsv+VFUD68H5cUw+R9iszWNy2btiNC+USPCugNhH\/d1eKUMHks3jh7P1tOUeHLl+ee9WP8re39\/22pCc31UHjd8ny9kBZjOFI6uIE0rGFyvm8HWz22lCzSsFhrw7mPljJoVAyvCPhE1oXJjSh0wNuiqGphmqTKWonmUpgwmplrtPLXl7P\/brF1OqIu\/6+ulME7SfOG4Od\/a3Rfd8mlU2QfhM15gjPtlhBiuKTIiVhzkrjPtdgjgYVppP1hKFryBT275PUW2alzuaq5VAK6Be3ts7t\/yRARNP\/kVNIlvoq3mPRG6WXL+AgB+WsYnEBEUIbuZSqKlDsSTubn7kn60SOLLpVGwQofZEKY1eF\/hJuoY31QJFoRwSQgimm9bNlgYJwKrnrwGhgYB4wECZG18oBWFAlrjdH4G0UuyRAecRd+8yY6\/g4VGRnYWC9TZOARQmPKdp+GgDmyDryIwaLUT2jIkZIjjfriMcczpJJkb\/D50t30fsGaiG5aDRGc+VHZJHX+idOGVs8QwXEgVUNEZbb8w6KgjuzCSEACbHaM6mmEeE0LcMn31G7YhXlCzC8kE1V0lMfHQHEinUzQ3AX\/J0gynxJD4bPhuM1\/+d4VUcOhk9Ni9QPB4=', 'decode');
        return $data ;
    }
    public function Iyuntext(){
        // var_dump(111);
        $data=FXApiService::regist('15973817741','1','Mm123456');
        return json_encode($data) ;
    }
    public function ceshi(){
    	 $out =proc_open("php think queue:work");
	 return $out;
    }
}
